package cn.semyes.ylipfilter.common.util;

import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;

/**
 * 生成json请求数据的类
 * @author cwd
 *
 */
public class CreateJsonObject {
	
	private JSONObject header;//创建json格式的数据    
	private JSONObject params;//创建json格式的数据
	
	private JSONObject body;//创建json格式的数据    
	private JSONObject getAccountInfoRequest;//创建json格式的数据    
	private JSONObject totalJson = new JSONObject();  
	
	//生成请求百度数据的json包
	public JSONObject getJsonObject(String access_token, JSONObject jsonParams) {
		header = new JSONObject();
		params = new JSONObject();
		
		body = new JSONObject();
		getAccountInfoRequest = new JSONObject();
		totalJson = new JSONObject();
				
		
		params.put("token", "de86e485832d365067078dda4cd2d2eb");
		params.put("accessToken", access_token);
		header.put("header", params);
		
		getAccountInfoRequest.put("accountInfo", jsonParams);
		body.put("body", getAccountInfoRequest);
		totalJson.putAll(header);
		totalJson.putAll(body);
		return totalJson;
	}
}
